package 滑动窗口And双指针;

/**
 * @author aodre , QQ : 480029069
 * @date 2023/8/18 16:01
 */
public class lc11盛水最多的容器 {




    public int sovle(int nums[]){
        int ans = 0, l = 0, r = nums.length - 1;
        while(l < r){
            if(nums[l] < nums[r]){
                ans = Math.max(nums[l] * (r - l),ans);
                l++;
            }else{
                ans = Math.max(nums[r] * (r - l),ans);
                r--;
            }
        }

        return ans;
    }

}
